﻿namespace EFS.Common.Functions
{
	public static class Guid
	{
		// strip {} from guid 
		public static System.String Strip(System.Guid guid)
		{
			System.String sguid = guid.ToString();
			sguid = sguid.Replace("{", "");
			sguid = sguid.Replace("}", "");
			sguid = sguid.ToLower();
			return sguid;
		}

		/// From string
		public static System.Guid? From(System.String value)
		{
			// try parse
			try
			{
				return new System.Guid(value);
			}
			catch (System.Exception) { }

			// none
			return null;
		}
	}

}